package com.lancoo.ccas53.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lancoo.ccas53.pojo.dto.TeacherDto;
import com.lancoo.ccas53.pojo.dto.TeacherSelfDto;
import com.lancoo.ccas53.pojo.vo.AllScheduleVo;
import com.lancoo.ccas53.pojo.vo.TeacherCourseVo;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

import com.lancoo.ccas53.entity.Teacher;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lancoo.ccas53.config.MybatisRedisCache;
import org.apache.ibatis.annotations.CacheNamespace;

/**
 * <p>
 * 教师 Mapper 接口
 * </p>
 *
 * @author quin.song
 * @since 2024-05-20
 */
@CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class)
public interface TeacherMapper extends BaseMapper<Teacher> {

    int addBatch(@Param("teacherCollection") Collection<Teacher> teacherCollection);

    /**
     * 获取教师课程信息
     * @param page
     * @param taskId
     * @param campusId
     * @param basCollegeId
     * @param identity
     * @param isCampusCross
     * @param keyword
     * @param courseId
     * @return
     */
    IPage<TeacherCourseVo> getTeacherCourse(@Param("page") Page page, @Param("taskId") Integer taskId, @Param("campusId") Integer campusId,
                                            @Param("basCollegeId") String basCollegeId, @Param("identity") Integer identity,
                                            @Param("isCampusCross") Integer isCampusCross, @Param("keyword") String keyword, @Param("courseId") Long courseId);

    /**
     * 根据教学班id获取其教师信息
     * @param teachingClassIds
     * @return
     */
    List<TeacherDto> getTeacherByTeachingClassIds(@Param("teachingClassIds") List<Long> teachingClassIds);

    int updateTeacherList(@Param("isCampusCross") Integer isCampusCross,@Param("identity") Integer identity,@Param("campusId") Integer campusId,@Param("campusName") String campusName,@Param("taskId") Integer taskId);

    int deleteTeacherByTaskId(@Param("taskId") Integer taskId,@Param("teacherIds") List<Long> teacherIds);

    IPage<AllScheduleVo> getAllTeacherPage(Page<AllScheduleVo> page, Integer taskId, String collegeId, String keyword);

    List<Long> getAllTeachierId(Integer taskId);

    List<TeacherSelfDto> getTeacherByIds(@Param("teacherIds") List<Long> teacherIds);

    List<Teacher> getSimpleInfo(Integer taskId);
}
